$(function () {
	$.getJSON( "movies", function( data ) {
		var items = [];
		search_movie_id = $( ".search_movie_id" ).attr("id");
		var ul = $('<ul class="movie_list columns-8">').appendTo('#image-gallery');
		$.each( data, function( key, val ) {
			ul.append( '<li class="movie_thumbnail"><a href="/movie/change/'+search_movie_id+'/'+key+'"><img src="'+val["poster"]+'" class="poster"/><h5>'+val["title"]+'</h5></a></li>' );
		});
		$( "#image-gallery" ).append( items.join( "" ) )

	});
});


